<template>
	<view>
		<u-cell  :border='false' title=" "></u-cell>
		<u-cell  :border='false' title=" "></u-cell>
		<u-cell  :border='false' title=" "></u-cell>
		<u-row>
			<u-col span="10" offset="1">
				 <u--input
				    placeholder="给店铺起个名吧"
				    border="surround"
				    v-model="shopName" 
				  ></u--input>
			</u-col>
		</u-row>
		<u-cell  :border='false' title=" "></u-cell><u-cell  :border='false' title=" "></u-cell>
		<u-row >
			<u-col span="10" offset="1">
				<u-button type="primary"  @click="addO" text="我想好了"></u-button>
			</u-col>
		</u-row>
	 
	</view>
</template>

<script>
	var that
	var UserInfo = require('../../../service/UserInfo.js'),mUserInfo
	export default {
		data() {
			return {
				id:'',
				shopName:'',
				userInfo:{}
			}
		},
		onLoad(op){
			console.log('传过来的id',this.id)
			that = this
			if(op.id){
				this.id = op.id
			}
			mUserInfo = new UserInfo(this.mNetTool)
		},
		mounted() {
			uni.showModal({
				title:'提示',
				showCancel:false,
				content:'恭喜您获得1个月会员体验资格，快给您的第一个店铺起个名吧',
			})
			let a = uni.getStorageSync('userInfo')
			if(a){
				that.userInfo = a
			}
			
		},
		methods: {
			addO(){
				uni.showLoading({
					title:'初始化账户中'
				}) 
				this.mNetTool.getAjaxUrlValueBackground('capi/V2/ERShopManage/erShopManage/save',
				{  
					owner_id:that.userInfo.id,
					shop_name:that.shopName
				},res => {
					 uni.navigateBack({
					 	delta:5
					 })
					 uni.hideLoading()
				})
			}
		}
	}
</script>

<style>

</style>
